package com.aspose.cells;

import java.util.HashMap;

public class zxx {
   private int a = 0;
   private boolean b = false;
   private zaha c;
   private short d = 0;
   private com.aspose.cells.b.a.c.za e;
   private com.aspose.cells.a.a.za f;
   private zate g;
   private zhm h;
   private zhb i;
   private String[] j;
   private HashMap k;
   private zhj l;
   private zxu m = new zxu();
   private int n = 11;

   public zxx() {
      this.a((com.aspose.cells.b.a.c.za)null);
   }

   public zxx(com.aspose.cells.b.a.c.za var1) {
      this.a(var1);
   }

   public zxx(int var1) {
      if (var1 == 0) {
         this.a((com.aspose.cells.b.a.c.za)null);
      } else {
         this.a(var1);
      }

   }

   public void a(zxx var1) {
      this.b = var1.b;
      this.a = var1.a;
      this.e = var1.e;
      this.d = var1.d;
      this.f = var1.f;
      this.n = var1.n;
      this.i = null;
      this.h = null;
      this.j = null;
      this.k = null;
      this.l = null;
   }

   private void n() {
      this.f = new com.aspose.cells.a.a.za(this.e);
      this.i = null;
      this.h = null;
      this.j = null;
      this.k = null;
      this.l = null;
   }

   public void a(char var1, char var2) {
      this.f = new com.aspose.cells.a.a.za(this.f, var1, var2);
      this.i = null;
      this.h = null;
      this.j = null;
      this.k = null;
      this.l = null;
   }

   public com.aspose.cells.b.a.c.za a() {
      return this.e;
   }

   public void a(com.aspose.cells.b.a.c.za var1) {
      if (var1 == null) {
         if (this.e == null || this.a != 0) {
            this.e = com.aspose.cells.b.a.c.za.a();
            this.a = 0;
            this.d = (short)this.e.g();
            this.n();
         }
      } else {
         this.e = var1;
         this.d = (short)this.e.g();
         this.a = zaku.b(this.d);
         this.n();
      }

   }

   public int b() {
      return this.a;
   }

   public void a(int var1) {
      if (this.a != var1) {
         this.a = var1;
         if (var1 == 0) {
            this.e = com.aspose.cells.b.a.c.za.a();
            this.d = (short)this.e.g();
         } else {
            this.d = zaku.c(var1);
            this.e = com.aspose.cells.a.c.zj.a(var1);
         }

         this.n();
      }

   }

   public boolean c() {
      return this.b;
   }

   public void a(boolean var1) {
      this.b = var1;
   }

   public zaha d() {
      return this.c;
   }

   public void a(zaha var1) {
      this.c = var1;
   }

   public short e() {
      return this.d;
   }

   public com.aspose.cells.a.a.za f() {
      return this.f;
   }

   public zate g() {
      if (this.g == null) {
         this.g = new zate();
         this.g.a(this);
         this.g.a((zahk)(new zhn(this.g)));
      }

      return this.g;
   }

   public zhm h() {
      if (this.h == null) {
         this.h = new zhm(this.g());
      }

      return this.h;
   }

   public zhb i() {
      if (this.i == null) {
         this.i = new zhb(this.g());
      }

      return this.i;
   }

   public static int b(int var0) {
      if (var0 == 0) {
         return 0;
      } else if (var0 < 11) {
         return 2;
      } else if (var0 < 12) {
         return 5;
      } else if (var0 < 14) {
         return 4;
      } else if (var0 < 23) {
         return 3;
      } else if (var0 < 27) {
         return 2;
      } else if (var0 < 37) {
         return 3;
      } else if (var0 < 41) {
         return 2;
      } else if (var0 < 45) {
         return 6;
      } else if (var0 < 48) {
         return 3;
      } else if (var0 < 49) {
         return 5;
      } else if (var0 < 50) {
         return 1;
      } else {
         return var0 < 59 ? 3 : 0;
      }
   }

   public static int c(int var0) {
      if (var0 == 0) {
         return 0;
      } else if (var0 < 11) {
         return 2;
      } else if (var0 < 12) {
         return 6;
      } else if (var0 < 14) {
         return 5;
      } else if (var0 < 18) {
         return 3;
      } else if (var0 < 23) {
         return 4;
      } else if (var0 < 27) {
         return 2;
      } else if (var0 < 37) {
         return 3;
      } else if (var0 < 41) {
         return 2;
      } else if (var0 < 45) {
         return 0;
      } else if (var0 < 48) {
         return 4;
      } else if (var0 < 49) {
         return 6;
      } else if (var0 < 50) {
         return 1;
      } else if (var0 < 55) {
         return 3;
      } else if (var0 < 57) {
         return 4;
      } else {
         return var0 < 59 ? 3 : 0;
      }
   }

   public int a(String var1) {
      if (this.j == null) {
         this.o();
      }

      var1 = com.aspose.cells.b.a.zv.a(var1, this.e.d().d(), "\"" + this.e.d().d() + "\"");

      for(int var2 = 1; var2 < 59; ++var2) {
         if (com.aspose.cells.b.a.zv.b(var1, this.j[var2])) {
            return var2;
         }
      }

      return -1;
   }

   public String d(int var1) {
      if (var1 >= 0 && var1 <= 59) {
         if (this.j == null) {
            this.o();
         }

         return this.j[var1];
      } else {
         return null;
      }
   }

   private void o() {
      String var1 = "\"" + this.e.d().d() + "\"";
      StringBuilder var2 = new StringBuilder(20);
      this.j = new String[59];
      this.j[0] = "General";
      this.j[1] = "0";
      this.j[2] = "0.00";
      this.j[3] = "#,##0";
      this.j[4] = "#,##0.00";
      if (zaku.b((int)this.d)) {
         var2.setLength(0);
         this.j[5] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0;").append(var1).append("-#,##0"));
         var2.setLength(0);
         this.j[6] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0;[Red]").append(var1).append("-#,##0"));
         var2.setLength(0);
         this.j[7] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0.00;").append(var1).append("-#,##0.00"));
         var2.setLength(0);
         this.j[8] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0.00;[Red]").append(var1).append("-#,##0.00"));
         this.j[37] = "#,##0;-#,##0";
         this.j[38] = "#,##0;[Red]-#,##0";
         this.j[39] = "#,##0.00;-#,##0.00";
         this.j[40] = "#,##0.00;[Red]-#,##0.00";
         this.j[41] = "_ * #,##0_ ;_ * -#,##0_ ;_ * \"-\"_ ;_ @_ ";
         var2.setLength(0);
         this.j[42] = com.aspose.cells.b.a.zr.a(var2.append("_ ").append(var1).append("* #,##0_ ;_ ").append(var1).append("* -#,##0_ ;_ ").append(var1).append("* \"-\"_ ;_ @_ "));
         this.j[43] = "_ * #,##0.00_ ;_ * -#,##0.00_ ;_ * \"-\"??_ ;_ @_ ";
         var2.setLength(0);
         this.j[44] = com.aspose.cells.b.a.zr.a(var2.append("_ ").append(var1).append("* #,##0.00_ ;_ ").append(var1).append("* -#,##0.00_ ;_ ").append(var1).append("* \"-\"??_ ;_ @_ "));
      } else {
         var2.setLength(0);
         this.j[5] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0_);(").append(var1).append("#,##0)"));
         var2.setLength(0);
         this.j[6] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0_);[Red](").append(var1).append("#,##0)"));
         var2.setLength(0);
         this.j[7] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0.00_);(").append(var1).append("#,##0.00)"));
         var2.setLength(0);
         this.j[8] = com.aspose.cells.b.a.zr.a(var2.append(var1).append("#,##0.00_);[Red](").append(var1).append("#,##0.00)"));
         this.j[37] = "#,##0_);(#,##0)";
         this.j[38] = "#,##0_);[Red](#,##0)";
         this.j[39] = "#,##0.00_);(#,##0.00)";
         this.j[40] = "#,##0.00_);[Red](#,##0.00)";
         this.j[41] = "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)";
         var2.setLength(0);
         this.j[42] = com.aspose.cells.b.a.zr.a(var2.append("_(").append(var1).append("* #,##0_);_(").append(var1).append("* (#,##0);_(").append(var1).append("* \"-\"_);_(@_)"));
         this.j[43] = "_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)";
         var2.setLength(0);
         this.j[44] = com.aspose.cells.b.a.zr.a(var2.append("_(").append(var1).append("* #,##0.00_);_(").append(var1).append("* (#,##0.00);_(").append(var1).append("* \"-\"??_);_(@_)"));
      }

      this.j[9] = "0%";
      this.j[10] = "0.00%";
      this.j[11] = "0.00E+00";
      this.j[12] = "# ?/?";
      this.j[13] = "# ??/??";
      var2.setLength(0);
      this.j[14] = com.aspose.cells.b.a.zr.a(this.a("yyyy", this.f.i(), this.f.j(), var2));
      if (zaku.a((short)7, this.d)) {
         var2.setLength(0);
         this.j[15] = com.aspose.cells.b.a.zr.a(var2.append(this.f.j()).append(".MMM yy"));
         var2.setLength(0);
         this.j[16] = com.aspose.cells.b.a.zr.a(var2.append(this.f.j()).append(".MMM"));
      } else {
         var2.setLength(0);
         this.j[15] = com.aspose.cells.b.a.zr.a(var2.append(this.f.j()).append("-MMM-yy"));
         var2.setLength(0);
         this.j[16] = com.aspose.cells.b.a.zr.a(var2.append(this.f.j()).append("-MMM"));
      }

      this.j[17] = "MMM-yy";
      this.j[18] = "h:mm AM/PM";
      this.j[19] = "h:mm:ss AM/PM";
      this.j[20] = "h:mm";
      var2.setLength(0);
      this.j[21] = com.aspose.cells.b.a.zr.a(var2.append(this.f.k()).append(":").append(this.f.l()).append(":").append(this.f.m()));
      var2.setLength(0);
      this.j[22] = com.aspose.cells.b.a.zr.a(var2.append(this.j[14]).append(" h:mm"));
      this.j[23] = "\"$\"#,##0;(\"$\"#,##0)";
      this.j[24] = this.j[23];
      this.j[25] = "\"$\"#,##0.00;(\"$\"#,##0.00)";
      this.j[26] = this.j[25];
      var2.setLength(0);
      this.j[30] = com.aspose.cells.b.a.zr.a(var2.append(this.f.i()).append(this.f.g()).append(this.f.j()).append(this.f.g()).append("yy"));
      if (zaku.a((short)17, this.d)) {
         this.j[27] = "ge.m.d";
         this.j[28] = "ggge\"年\"m\"月\"d\"日\"";
         this.j[29] = this.j[28];
         this.j[31] = "yyyy\"年\"m\"月\"d\"日\"";
         this.j[32] = "h\"時\"mm\"分\"";
         this.j[33] = "h\"時\"mm\"分\"ss\"秒\"";
         this.j[34] = "yyyy\"年\"m\"月\"";
         this.j[35] = "m\"月\"d\"日\"";
      } else if (zaku.a((short)18, this.d)) {
         this.j[27] = "yyyy\"年\" mm\"月\" dd\"日\"";
         this.j[28] = "mm-dd";
         this.j[29] = this.j[28];
         this.j[31] = "yyyy\"년\" mm\"월\" dd\"일\"";
         this.j[32] = "h\"시\" mm\"분\"";
         this.j[33] = "h\"시\" mm\"분\" ss\"초\"";
         this.j[34] = "yyyy-mm-dd";
         this.j[35] = this.j[34];
      } else {
         var2.setLength(0);
         this.j[27] = com.aspose.cells.b.a.zr.a(var2.append("yyyy\"").append('年').append('"').append(this.f.i()).append('"').append('月').append('"'));
         var2.setLength(0);
         this.j[28] = com.aspose.cells.b.a.zr.a(var2.append(this.f.i()).append('"').append('月').append('"').append(this.f.j()).append('"').append('日').append('"'));
         this.j[29] = this.j[28];
         char var3 = 26102;
         switch(this.d) {
         case 1028:
         case 3076:
         case 5124:
         case 31748:
            var3 = 26178;
         default:
            var2.setLength(0);
            this.j[31] = com.aspose.cells.b.a.zr.a(this.a("yyyy", "\"年\"", this.f.i(), "\"月\"", this.f.j(), "\"" + Character.toString('日') + "\"", var2));
            var2.setLength(0);
            this.j[32] = com.aspose.cells.b.a.zr.a(var2.append(this.f.k()).append('"').append(var3).append("\"mm\"").append('分').append('"'));
            var2.setLength(0);
            this.j[33] = com.aspose.cells.b.a.zr.a(var2.append(this.j[32]).append("ss\"").append('秒').append('"'));
            var2.setLength(0);
            this.j[34] = com.aspose.cells.b.a.zr.a(var2.append(zml.b).append('/').append(zml.c).append(this.j[32]));
            var2.setLength(0);
            this.j[35] = com.aspose.cells.b.a.zr.a(var2.append(this.j[34]).append("ss\"").append('秒').append('"'));
         }
      }

      this.j[36] = this.j[27];
      this.j[45] = "mm:ss";
      this.j[46] = "[h]:mm:ss";
      this.j[47] = "mm:ss.0";
      this.j[48] = "##0.0E+0";
      this.j[49] = "@";
      this.j[50] = this.j[27];
      this.j[51] = this.j[28];
      this.j[52] = this.j[27];
      this.j[53] = this.j[28];
      this.j[54] = this.j[28];
      this.j[55] = this.j[34];
      this.j[56] = this.j[35];
      this.j[57] = this.j[27];
      this.j[58] = this.j[28];
   }

   public zxu j() {
      return this.m;
   }

   public zxz a(int var1, Object var2) {
      return this.e(var1).a(this.m, var2);
   }

   public zxz a(String var1, Object var2, boolean var3) {
      return this.a(var1, var3).a(this.m, var2);
   }

   public zafy a(Style var1) {
      return var1.getCustom() != null && !"".equals(var1.getCustom()) ? this.a(var1.getCustom(), true) : this.e(var1.getNumber());
   }

   public zafy e(int var1) {
      if (var1 == 0) {
         return this.k();
      } else {
         String var2 = this.d(var1);
         return (zafy)(var2 == null ? this.k() : this.a(var2, true));
      }
   }

   public zafy a(String var1, boolean var2) {
      if (var1 != null && !var1.equals("General")) {
         if (this.k != null) {
            Object var3 = this.k.get(var1);
            if (var3 != null) {
               return (zafy)var3;
            }
         } else if (var2) {
            this.k = new HashMap(50);
         }

         return (new zya(this)).a(var1, var2);
      } else {
         return this.k();
      }
   }

   public zafy b(String var1, boolean var2) {
      if (var1 != null && !var1.equals("General")) {
         if (var2 && this.k == null) {
            this.k = new HashMap(50);
         }

         return (new zya(this)).a(var1, var2);
      } else {
         return this.k();
      }
   }

   public zhj k() {
      if (this.l == null) {
         zhh var1 = new zhh();
         var1.a(this);
         this.l = new zhj(var1, (zj)null, (zj)null);
      }

      return this.l;
   }

   public int a(zafy var1, Object var2) {
      return var1.a() == 6 ? ((zyb)var1).b(var2) : var1.g();
   }

   public int l() {
      return this.n;
   }

   public HashMap m() {
      return this.k;
   }

   public StringBuilder a(String var1, String var2, String var3, StringBuilder var4) {
      if (var4 == null) {
         var4 = new StringBuilder();
      }

      switch(this.f.f()) {
      case 2:
         var4.append(var2);
         var4.append(this.f.g());
         var4.append(var3);
         var4.append(this.f.g());
         var4.append(var1);
         break;
      case 3:
         var4.append(var3);
         var4.append(this.f.g());
         var4.append(var2);
         var4.append(this.f.g());
         var4.append(var1);
         break;
      case 4:
         var4.append(var1);
         var4.append(this.f.g());
         var4.append(var2);
         var4.append(this.f.g());
         var4.append(var3);
         break;
      case 5:
         var4.append(var1);
         var4.append(this.f.g());
         var4.append(var3);
         var4.append(this.f.g());
         var4.append(var2);
         break;
      case 6:
         var4.append(var2);
         var4.append(this.f.g());
         var4.append(var1);
         var4.append(this.f.g());
         var4.append(var3);
         break;
      case 7:
         var4.append(var3);
         var4.append(this.f.g());
         var4.append(var1);
         var4.append(this.f.g());
         var4.append(var2);
      }

      return var4;
   }

   public StringBuilder a(String var1, String var2, String var3, String var4, String var5, String var6, StringBuilder var7) {
      if (var7 == null) {
         var7 = new StringBuilder();
      }

      switch(this.f.f()) {
      case 2:
         var7.append(var3);
         var7.append(var4);
         var7.append(var5);
         var7.append(var6);
         var7.append(var1);
         var7.append(var2);
         break;
      case 3:
         var7.append(var5);
         var7.append(var6);
         var7.append(var3);
         var7.append(var4);
         var7.append(var1);
         var7.append(var2);
         break;
      case 4:
         var7.append(var1);
         var7.append(var2);
         var7.append(var3);
         var7.append(var4);
         var7.append(var5);
         var7.append(var6);
         break;
      case 5:
         var7.append(var1);
         var7.append(var2);
         var7.append(var5);
         var7.append(var6);
         var7.append(var3);
         var7.append(var4);
         break;
      case 6:
         var7.append(var3);
         var7.append(var4);
         var7.append(var1);
         var7.append(var2);
         var7.append(var5);
         var7.append(var6);
         break;
      case 7:
         var7.append(var5);
         var7.append(var6);
         var7.append(var1);
         var7.append(var2);
         var7.append(var3);
         var7.append(var4);
      }

      return var7;
   }
}
